<%@ page import="top.wuyang.study.javawebjdbc.workgonggao.TbGonggao" %>
<%@ page import="top.wuyang.study.javawebjdbc.workgonggao.TbGonggaoDAO" %><%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2024/5/21
  Time: 9:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加公告</title>
</head>
<body>

<%
    request.setCharacterEncoding("UTF-8");
    TbGonggao tbGonggao = new TbGonggao();
    tbGonggao.setGgtitle( request.getParameter("ggtitle") );
    tbGonggao.setGgauthor( request.getParameter("ggauthor") );
    tbGonggao.setGginfo( request.getParameter("gginfo") );
    int i = TbGonggaoDAO.insert(tbGonggao);
    String message = "添加失败";
    if (i==1){
        message = "添加成功";
    }
%>


<script>
    alert("<%=message%>");
    location.href = "gonggao.jsp";
</script>

</body>
</html>
